import {service,servicemock} from "@/api";
export default {
    namespaced:true,
	actions: {

		//获取三联导航数据
		async getTypeNavList({commit}){
			const TypeNavList=await service({url:'/product/getBaseCategoryList'})
			
			commit('GETTYPENAVLIST',TypeNavList)
		}, 

		//获取banner数据
		async getBannerList({commit}){
			const BannerList=await servicemock({url:'/banner'})
		
			commit('GETBANNERLIST',BannerList.data.data)
		},

		//获取floor组件数据
		async getFloorList({commit}){
			const FloorList=await servicemock({url:'/floor'})
			commit('GETFlOORLIST',FloorList.data.data)
		}


		
	},
	mutations: {
		//获取三联导航数据
		GETTYPENAVLIST(state,TypeNavList){
			//由于接口返回的数据是16个样式编的是15个  切一个成15个好看点
			TypeNavList=TypeNavList.data.data.splice(0,TypeNavList.data.data.length-2)
		
			state.TypeNavList=TypeNavList
			
		},

		//获取banner数据
		GETBANNERLIST(state,BannerList){
			state.BannerList=BannerList
		},

		//Floor组件获取floor数据

		GETFlOORLIST(state,FloorList){
			state.FloorList=FloorList
		}





	},
	state: {
		TypeNavList:[],
		BannerList:[],
		FloorList:[]
	},
	getters: {
		
	},
};
